<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title>医疗数据管理后台首页</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta http-equiv="Access-Control-Allow-Origin" content="*">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="format-detection" content="telephone=no">
  <link rel="icon" href="/resources/favicon.ico">
  <link rel="stylesheet" href="/resources/layui/css/layui.css" media="all" />
  <script type="text/javascript" src="/resources/layui/layui.js"></script>
</head>



<body>
<a href="/sys/toDeskManager" class="layui-btn" style="margin-top: 10px;margin-left: 10px;position: fixed">返回</a>
<!-- 创建一个容器，用于放置标题和内容 -->
<div class="layui-container">
  <h1 class="layui-h1 hot_news_name"></h1>
  <div class="layui-text hot_news_content" style="white-space: pre-wrap;"></div>
</div>



<script>
  function getUrlParam(name) {
    var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
    return results == null ? null : decodeURI(results[1]) || 0;
  }

  var i = getUrlParam('i');
  console.log(i);


  layui.use(['jquery'], function () {
    $ = layui.jquery;
    $.get("/resources/json/newsList.json",function(data){
      //形成hotNewsHTml
      var hotNewsName = '';
      hotNewsName += data.data[i].newsName;
      var hotNewsContent = '';
      hotNewsContent += data.data[i].content;
      // console.log(hotNewsContent);

      $(".hot_news_name").html(hotNewsName);
      $(".hot_news_content").html(hotNewsContent);
    })
  })


</script>

</body>
</html>